/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MonsterType;

import Core.Vector2;
import Environment.Gravity;
import FlyingType.FireBullet;
import Thing.Monster;
import java.util.Random;

/**
 *
 * @author DELL
 */
public class Land extends Monster{
    
    public Land()
    {       
        
        super();
    }
    
    public Land(String pathImage, int frameWidth, int frameHeight, int[] rightSeq, int[] shootSeq, Thing.Character h)
    {
        super(pathImage,frameWidth,frameHeight,rightSeq,shootSeq,h);
        MAX_RANGE = 600;
        health = 100;        
        Random rnd = new Random(System.currentTimeMillis());
        this.range = (int) rnd.nextInt() % MAX_RANGE;
    }
    
    public void update()
    {
        sprite.defineCollisionRectangle( sprite.getWidth()*1/4, sprite.getHeight()*10/13, sprite.getWidth()*2/4,6);
        Gravity.Enable(this);
        
        if(range<0){
            if(!status.isLeft()){
                moveLeft();
            }
        }
        else if(range>=0){
            if(!status.isRight()){
                moveRight();     
            }
        }
        
        super.update();
    }
    
    public void Shoot(Vector2 direction)
    {
        if(fly == null)
        {
            int[] seq = {9,9,9,9,8,8,8,8,7,7,7,7};
            fly = new FireBullet(seq);
            //fly.setTransForm(Sprite.TRANS_ROT180);
        }
        super.Shoot(direction);
    }
}
